package com.marcjmcd.cop4331;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.Button;

public class Site extends Activity
{
	WebView site;
	
	protected void onCreate(Bundle savedInstanceState)
	{
		super.onCreate(savedInstanceState);
		setContentView(R.layout.site);
		
		site = (WebView) findViewById(R.id.webView1);
		site.getSettings().setJavaScriptEnabled(true);
		site.loadUrl("https://sites.google.com/site/ooprogrammers/");
		
		site.setWebViewClient(new WebViewClient(){
			
			public boolean shouldOverrideUrlLoading(WebView view, String url)
			{
				view.loadUrl(url);
				
				return true;
			}
		});
		
		Button back = (Button) findViewById(R.id.button16);
		
		back.setOnClickListener(new OnClickListener() {
			
		@Override
		public void onClick(View v) 
		{
			Context context = getApplicationContext();
			
			//Go back to main!
			startActivity(new Intent(context, Main.class));
		}
		});
	}
}
